Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: revoke recurring grants #1446

Merged
merged 5 commits into from
Sep 10, 2024
Merged

feat: revoke recurring grants #1446

merged 5 commits into from
Sep 10, 2024

Conversation

rico191013
Copy link
Contributor

@rico191013 rico191013 self-assigned this Jul 28, 2024
@github-actions github-actions bot added package: wallet/frontend Wallet frontend implementations package: wallet/backend Wallet backend implementations type: source Source changes package: boutique/backend Boutique backend implementations labels Jul 28, 2024
# Conflicts:
#	packages/boutique/backend/src/order/controller.ts
@github-actions github-actions bot removed the package: wallet/frontend Wallet frontend implementations label Jul 28, 2024
@rico191013 rico191013 changed the title Revoke recurring grants feat: revoke recurring grants Jul 28, 2024
Tymmmy
Tymmmy previously approved these changes Jul 30, 2024
# Conflicts:
#	packages/wallet/backend/src/grant/service.ts
@@ -222,10 +222,11 @@ export class OrderController implements IOrderController {
res: TypedResponse<CreateResponse>,
next: NextFunction
) => {
let order: Order
try {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I get this right, but is this just a delete of the orderService in case the creation did not work due to having the OP client unauthorized?

If that is the case, Couldn't this just be a transaction that is rolled back, instead of a new specific delete call?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, I tried it out. First, I moved the instantBuy method into the transaction block, but it didn’t work. It seemed that the order created in the transaction block wasn’t fully completed, which caused some database errors in the instantBuy method. So, I had to implement it this way instead.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, if you're certain about it.
However, maybe in this case the Order.transaction(){} blocks are no longer needed, just
try{
orderService.create()
}
catch{
orderService.delete()
}
?

@Tymmmy Tymmmy merged commit 4af36ad into main Sep 10, 2024
15 checks passed
@Tymmmy Tymmmy deleted the revoke-recurring-grants branch September 10, 2024 09:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: boutique/backend Boutique backend implementations type: source Source changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove orders that related to revoked grants
3 participants